<template>

  <div>计数器 {{$store.state.count}}  <button @click="increment">点击</button></div>


</template>
<script>
export default {
  data(){
    return {
      counter:0
    }
  },
  methods:{
    increment(){
     // this.counter++;
     this.$store.dispatch('SET_COUNT',2);
      console.log(this.$store.state.count)
    }
  }
}
</script>